package com.sx.pipeline.repos.http.service

import com.sx.pipeline.app.config.BaseEntity
import com.sx.pipeline.repos.http.req.AddAdministrativeDTO
import com.sx.pipeline.repos.http.req.AddGroupDTO
import com.sx.pipeline.repos.http.req.CreateGroupDTO
import com.sx.pipeline.repos.http.req.ExitGroupDTO
import com.sx.pipeline.repos.http.req.TaskCreateGroupDTO
import com.sx.pipeline.repos.http.res.*
import com.sx.pipeline.view.treeview2.OrganizeDeptRes
import io.reactivex.rxjava3.core.Observable
import retrofit2.http.*

/**
 * @Author: YY
 * @Date: 2022/5/19
 * @Description: 工作台模块 - 接口
 */
interface IRongImService {

    /**
     * 融云联系人列表
     */
    @GET("/api/ums/ry/contactPage")
    fun getRongContact(
        @Query("name") name: String,
    ): Observable<BaseEntity<List<ContactUserVo>>>

    /**
     * 融云所有用户信息列表
     */
    @GET("/api/ums/ry/ryGroupInfoList")
    fun getRongAllContact(
    ): Observable<BaseEntity<List<ContactUserVo>>>

    /**
     * 融云联系人个人信息
     */
    @GET("/api/ums/ry/ryInfo/{id}")
    fun getRyPersonalInfo(@Path("id") id: Int): Observable<BaseEntity<RyUserVo>>

    /**
     * 组织架构列表
     */
    @GET("/api/ums/ry/personalCenter")
    fun getRongOrganize(): Observable<BaseEntity<List<OrganizeDeptRes>>>


    /**
     * 创建群聊
     */
    @POST("/api/ums/ry/createGroup")
    fun getCreateGroup(@Body dto: CreateGroupDTO): Observable<BaseEntity<Any>>

    /**
     * 任务创建群聊
     */
    @POST("/api/ums/ry/taskCreateGroup")
    fun getTaskCreateGroup(@Body dto: TaskCreateGroupDTO): Observable<BaseEntity<Any>>

    /**
     * 群组列表
     */
    @GET("/api/ums/ry/getGroupList")
    fun getRongGroupList(): Observable<BaseEntity<List<RongGroupVO>>>

    /**
     * 获取群组信息
     */
    @GET("/api/ums/ry/get/{id}")
    fun groupListInfo(@Path("id")id: String):Observable<BaseEntity<GroupDetailVo>>

    /**
     * 退出群聊
     */
    @POST("/api/ums/ry/exit")
    fun exitGroup(@Query("groupId")groupId: String):Observable<BaseEntity<Any>>

    /**
     * 加入群聊
     */
    @POST("/api/ums/ry/add")
    fun addGroup(@Query("groupId")groupId :String,@Query("userIds")userIds:String):Observable<BaseEntity<Any>>

    @POST("/api/ums/ry/quit")
    fun quitGroup(@Query("groupId")groupId :String,@Query("userIds")userIds:String):Observable<BaseEntity<Any>>

    /**
     * 解散群组
     */
    @POST("/api/ums/ry/dissolve")
    fun cleanGroup(@Query("groupId")groupId: String):Observable<BaseEntity<Any>>

    @GET("/api/ums/ry/groupContact")
    fun getContactList(@Query("groupId")groupId: String,@Query("userName")userName: String):Observable<BaseEntity<List<ContactUserVo>>>

}